package com.ukao.cashregister.dialog;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.ukao.cashregister.R;
import com.ukao.cashregister.base.BaseDialogFragment;
import com.ukao.cashregister.widget.StateButton;
import com.ukao.cashregister.widget.StateImageView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 打印提示
 */

public class PrintHideDialogFragment extends BaseDialogFragment {

    Unbinder unbinder;

    String deviceName;
    String printMachine;
    @BindView(R.id.close_btn)
    StateImageView closeBtn;
    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.hite)
    TextView hite;
    @BindView(R.id.know_btn)
    StateButton knowBtn;


    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        deviceName = getArguments().getString(ARG_PARAM1);
        printMachine = getArguments().getString(ARG_PARAM2);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.dialog_print_hide_fragment, container, false);
        unbinder = ButterKnife.bind(this, view);
        title.setText("提示");
        hite.setText("型号为" + deviceName + "的" + printMachine + "已连接好啦,请在设置里面查看");
        return view;
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }


    @OnClick({R.id.close_btn, R.id.know_btn})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.close_btn:
                dismiss();
                break;
            case R.id.know_btn:
                dismiss();
                break;
        }
    }
}
